Use case: read operations of CFI information ¶
|
HAL1 |
HAL2 |
|---|---|
|
The user reads the CFI information using
|
The user reads the CFI information using
|
Sequence diagram ¶
Code snippet ¶
|
HAL1 |
HAL2 |
|---|---|
NOR_HandleTypeDef hnor;
NOR_CFITypeDef nor_cfi;
/* Read CFI info */
HAL_NOR_Read_CFI(&hnor, &nor_cfi);
/* Return to read mode */
HAL_NOR_ReturnToReadMode(&hnor);
/* Read data from the NOR flash memory */
HAL_NOR_ReadBuffer(&hnor,
(uint32_t *)NOR_StartAddress,
read_data_buffer,
buffer_size
);
|
hal_nor_handle_t hnor;
hal_nor_cfi_device_info_t device_info;
/* Retrieve NOR flash CFI information */
HAL_NOR_CFI_ReadDeviceInfo(&hnor, &device_info);
/* Reset the NOR flash device */
HAL_NOR_CFI_0001_Reset(&hnor);
/* Read data from the NOR flash memory */
HAL_NOR_CFI_0001_ReadArray(&hnor
(uint32_t *)NOR_StartAddress,
read_data_buffer,
buffer_size
);
|
Key changes ¶
HAL2 uses
HAL_NOR_CFI_ReadDeviceInfo()and then a command-set specific reset API (HAL_NOR_CFI_000x_Reset()).HAL2 uses command-set specific read APIs (
HAL_NOR_CFI_000x_ReadArray()orHAL_NOR_CFI_000x_Read()).

